<!-- ImagePreview -->
<template>
  <v-dialog
  persistent
  :value="value !== null"
  width="60%"
  :fullscreen="fullscreen"
  >
  <v-card>
    <v-app-bar dense color="primary" flat>
      <v-spacer></v-spacer>
      <v-btn text dark @click="closeHandle">
        <v-icon>close</v-icon>关闭
      </v-btn>
    </v-app-bar>
    <v-img dark v-if="value !== null"  :src="value"></v-img>
  </v-card>
</v-dialog>
</template>

<script>
export default {
  name: 'ImagePreview',
  props: {
    value: {
      type: String,
      default: null
    },
    fullscreen: {
      type: Boolean,
      default: true
    }
  },
  computed: {},
  methods: {
    closeHandle: function() {
      this.$emit('input', null)
    }
  }
}
</script>
